package world.criver.h50529.application;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import world.criver.h50529.controller.conAffirmPop;
import world.criver.h50529.data.daData;
import world.criver.h50529.data.daMaterial;

public class appAffirmPop extends Application {
    private String content;
    private Runnable fun;
    public appAffirmPop(String content, Runnable fun){
        this.content=content;
        this.fun=fun;
    }
    @Override
    public void start(Stage stage) throws Exception {
        FXMLLoader loader=new FXMLLoader(appAffirmPop.class.getResource(daData.resources_fxml_path+"affirmPop.fxml"));
        Scene sc=new Scene(loader.load());
        sc.setFill(null);
        stage.setScene(sc);
        conAffirmPop con=loader.getController();
        con.ini(this.content,this.fun,stage);
        stage.initStyle(StageStyle.TRANSPARENT);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.setTitle("操作确认");
        stage.getIcons().add(daMaterial.logo_128x128);
        stage.show();
    }
}
